package _11FlyWeightDesign;

public class Main11 {
    public static void main(String[] args) {
        TeacherFactory teacherFactory=new TeacherFactory();
        Teacher teacher1=teacherFactory.getTeacher("012345");
        Teacher teacher2=teacherFactory.getTeacher("0123456");
        Teacher teacher3=teacherFactory.getTeacher("012345");
        Teacher teacher4=teacherFactory.getTeacher("0123457");
        System.out.println(teacher1);
        System.out.println(teacher2);
        System.out.println(teacher3);
        System.out.println(teacher4);


        if(teacher1==teacher3){
            System.out.println("共享！");
        }else{
            System.out.println("非共享");
        }
    }
}
